<!-- 关注首页 -->
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../common/taglib.jsp"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>关注首页</title>
<meta name="viewport"
	content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="../common/base.jsp"></jsp:include>
<script src="${basePath}/resource/js/common/base.js"></script>
<script src="${basePath}/resource/js/common/init.js"></script>
<link href="${basePath}/resource/css/bootstrap.min.css" rel="stylesheet" >
<link href="${basePath}/resource/css/bootstrap-modal.css" rel="stylesheet" type="text/css" />
<link href="${basePath}/resource/css/joywindow.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="${basePath}/resource/css/weathers.css" rel="stylesheet">
<style type="text/css">
html,body,.containers,.body{height: 100%;font-family: 微软雅黑;}
.module-topbar, .wrapper-popup .sub-header {
    height: 44px;
    color: #3b3b3b;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 19;
    text-align: center;
    -wekbit-box-shadow: 0 1px 2px #cfcfcf;
    box-shadow: 0 1px 2px #cfcfcf;
    background: #f9f9f9;
}
.module-topbar a, .wrapper-popup .sub-header a {
    height: 44px;
    min-width: 30px;
    padding: 0 20px;
    font-size: 1.0625rem;
    line-height: 44px;
}
.fl {
    float: left;
}
.module-topbar span, .wrapper-popup .sub-header span {
    width: 100%;
    left: 0;
    position: absolute;
    font-size: 1.8rem;
    line-height: 44px;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: -1;
}
.module-topbar a i, .wrapper-popup .sub-header a i {
    color: #1bbffd;
}
.module-topbar i, .wrapper-popup .sub-header i {
    font-size: 25px;
}
.iconfont {
    font-family: "iconfont" !important;
    font-size: 16px;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke-width: 0.2px;
    -moz-osx-font-smoothing: grayscale;
}
.module-message-tip{
	    width: 100%;
	    height: 38px;
	    display: none;
	    position: fixed;
	    text-align: center;
	    line-height: 40px;
	    z-index: 99;
	    color: #fff;
	    background-color: #ff8200;
	    box-sizing: border-box;
	    text-decoration: none;
}

.module-message-tip:hover{
	color:#fff;
	text-decoration: none;
}
</style>
</head>
<body>
	<input type="hidden" value="${userTonken}" id="userTonken">
	<input type="hidden" value="${lang}" id="lang"> 
	<div class="containers">
	<%-- 	<header class="module-topbar">
	        <span><spring:message code="attention"/></span>
	      <!--   <a class="fr" href="/ShareNew/write.do?userToken=4378954029" id="writeShare"></a> -->
	    </header> --%>
	    <a class="module-message-tip" href="javascript:toMessages()" >	
	    </a>

		<section class="body"> <!-- 天气	  style="margin-top: 44px;" -->
		<div class="weathers">
			<div class="weath-top">
				<p class="top-left pull-left font-size-16" style="display: block;width:100px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
					<img src="${basePath}/resource/images/iconfont-location.png" width="20px" /> 
					<span id="cityName"><spring:message code="city"/></span> 
					<!-- <input type="text" class="form-control hide" id="autocompleteInput000" size="20" style="display: inline; width: 100px"> -->
				</p>
				<div class="top-center pull-left" style="display: block;">
					<div class="top-center pull-left "
						style="vertical-align: middle; display: inline table-cell;display: block;">
						<span class="temperature-small font-size-12" id="curTemperatueSmall"></span>
						 <img width="25" style="margin-top: -4px" id="weatherIconSmall" src="" alt="">

						<span class="font-size-16"></span> 
						<span id="aqiSmall" class="font-size-16"></span> 
						<span id="curWeatherSmall" class="font-size-16"></span>
						<span id="tempRegionSmall" class="font-size-16"></span>

					</div>
					<div class="top-center pull-right" style="vertical-align: middle; display: inline table-cell;display: block;">
					</div>
				</div>
				<img src="${basePath}/resource/images/iconfont-unfold.png" id="fold" class="top-right pull-right"></img>
			</div>

			<div id="weath-bd" style="overflow: hidden;display: none;">
				<div class="weath-center">
					<div class="center-left pull-left">
						<span class="temperature" id="curTemperatue">0</span> 
						<img id="weatherIcon" width="50" style="margin-top: -20px" src="${basePath}/resource/images/1x1.gif" alt="">
					</div>
					<div class="center-right pull-right">
						<div>
							<span id="curWeather" class="font-size-16"></span> 
						</div>
						<div>
							<span class="font-size-16"><spring:message code="visibility"/>: </span> 
							<span id="aqi" class="font-size-16"></span>
						</div>
					</div>
				</div>
				<div class="weath-bottom">
					<div class="bottom-left pull-left">
						<span class="font-size-16" id="tomorrow"></span> 
						<span id="tempRegion_tomorrow" class="font-size-16">0</span> 
						<span id="type_tomorrow">
							<img width="30"  style="margin-top: -5px;" src="" alt="">
						</span>
					</div>
					<div class="bottom-right pull-right">
						<span class="font-size-16" id="afterTomorrow"></span>
						<span id="tempRegion_aflterTomorrow" class="font-size-16">0</span>
					    <span id="type_aflterTomorrow">
					    	<img width="30" style="margin-top: -5px;" src="" alt="">
					    </span>
					</div>
				</div>
			</div>
		</div> 
		
		

		<!-- 分享 -->
		<div class="share">
			<div class="share-title"><spring:message code="share"/></div>
			<div class="share-bd text-center">
				<ul class="shareList" id="shareList">
					<li class="shareImg">
						<img src="${basePath}/resource/images/df.png" alt="">
					</li>
					<li class="shareImg">
						<img src="${basePath}/resource/images/df.png" alt="">
					</li>
					<li class="shareImg">
						<img src="${basePath}/resource/images/df.png" alt="">
					</li>
					<li class="shareImg">
						<img src="${basePath}/resource/images/df.png" alt="">
					</li>
				</ul>
			</div>
		</div>

		<!-- 舆情 -->
		<div class="sentiment">
			<div class="news-title-bar wj-news-title-bar">
				<span class="news-title"><spring:message code="opinion"/></span>
				<div class="search">
					<input id="search" placeholder="请输入搜索内容..." />
					<i class="fa fa-search" style="float: right;margin-right: 10px;margin-top: 3px;"></i>
					<!--隐藏关键字 -->
					<input id="wjKeyList" type="hidden" value="${kwss}" />
					<ul class="wj-search-list">
						<c:forEach  items="${kwss}" var="dList" varStatus="status">
							<li data-key="${dList}">${dList}</li>
						</c:forEach>
					</ul>
				</div>
				<div class="news-btn-group">
					<span class="set" data-toogle="modal" data-target="#myModal2"><i class="fa fa-lg fa-cog"></i></span>
					<span class="exponent"><i class="fa fa-lg fa-line-chart"></i></span>
				</div>
			</div>
			<div class="content" style="position: relative;">
			
			</div>
		</div>

		<!-- 收藏 -->
		<div class="collection" style="display: none;">
			<div class="collection-title"><spring:message code="navigation"/>
				<ul id="btnCommon" style="float:right;width:50%;margin-top: -2px;margin-bottom: 0px;">
					<li id="btnDelete" style="float: right;margin-left:20px;">
						<div class="collec-top">
							<img src="${basePath}/resource/images/navigation/iconfont-xx.png" class="bg" alt="" data-toggle="tooltip" data-placement="left">
						</div>
					</li>
					<li id="btnAdd" style="float: right;">
						<div class="collec-top">
							<img src="${basePath}/resource/images/navigation/iconfont-add.png" class="bg" alt="" data-toggle="tooltip" data-placement="left">
						</div>
						
					</li>
				</ul>
			</div>
			<div class="collection-bd">
				<ul id="colleList">
				</ul>
				
			</div>
				
		</div>
		<!-- 添加设置关键字对话框 -->
		<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModal2Label" style="top:12%">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header2">
						<div id="modal_text">
							<div class="modal_text">
								<input class="sub_text" placeholder="<spring:message code="enterKeyword"/>">
							</div>
							<img src="${basePath}/resource/images/weatherbg/key_words.png" >
						</div>
					</div>
				    <!-- 动态添加关键字-th  -->
					<div class="modal-body2">
						<c:forEach  items="${kwss}" var="dList" varStatus="status">
							<div><span class="vrv">${dList}</span>
							<span class="x">X</span></div>
						</c:forEach>
					</div>
					<div class="add_keywords">
						<p><spring:message code="validKeyWordLeft"/></p>
					</div>
					<div class="modal-footer2">
						<div class="btn_group">
							<input type="button" class="confirm" value="<spring:message code="ok"/>">
							<input type="button" class="cancel" value="<spring:message code="cancel"/>">
						</div>
					</div>
				</div>
			</div><!-- 添加导航对话框 -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<p><spring:message code="addNavigation"/></p>
					</div>
					<div class="modal-body">
						<form>
							<div class="form-group">
								<label for="txtTitle" class="control-label"><spring:message code="navigationName"/>:</label> <input
									type="text" class="form-control" id="txtTitle"
									placeholder="<spring:message code="writeTitle"/>"> <a rel="nofollow" href="#"
									class="tooltip-hide tooltip-warn" data-toggle="tooltip"
									id="tpTitle" data-placement="right" data-delay="500"
									title="请输入标题"></a>

							</div>
							<div class="form-group">
								<label for="txtUrl" class="control-label"><spring:message code="url"/>:</label> <input
									type="text" class="form-control" id="txtUrl"
									placeholder="<spring:message code="writeUrl"/>">
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<span class="alert alert-warning hide"> <a href="#"
							class="close" data-dismiss="alert"> &times; </a> <span
							id="lblCollectDialogInfo"></span>
						</span>

						<button type="button" id="btnSave" class="btn btn-primary"><spring:message code="save"/></button>
					</div>
				</div>
			</div>
		</div>
		<!-- 设置城市对话框 -->
		<div class="modal fade" id="myModalCity" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<p><spring:message code="setCity"/></p>
					</div>
					<div class="modal-body">
						<form>
							<div class="form-group">
								<label for="txtTitle" class="control-label"><spring:message code="cityOrRegion"/>:</label> <input
									type="text" class="form-control" id="autocompleteInput">
							</div>
							<div class="form-group">
								<label for="txtUrl2" class="control-label hide">其他:</label> <input
									type="text" class="form-control hide" id="txtUrl2">
								<button type="button" id="btnGetGpsCity" class="btn btn-sm"><spring:message code="obtainForgps"/></button>
								<span class="text-info warning" id="lblGpsInfo"></span>
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" id="btnSaveCity" class="btn btn-primary"><spring:message code="ok"/></button>
					</div>
				</div>
			</div>
		</div>

		<!-- 确认对话框 -->
		<div class="modal fade confirm_modal" id="confirm_modal_chinese">
			<div class="modal-body inner"></div>
			<div class="modal-footer">
				<a class="btn cancel" href="#" data-dismiss="modal"><spring:message code="cancel"/></a> <a
					href="#" class="btn btn-danger" data-action="1"><spring:message code="ok"/></a>
			</div>
		</div>

		<!-- 警告框 -->
		<div id="myModalAlert" class="modal hide fade" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h3 id="myModalAlertTitle">提示标题</h3>
			</div>
			<div class="modal-body">
				<p id="myModalAlertContent">提示内容！</p>
			</div>
			<div class="modal-footer">
				<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
			</div>
		</div>
		</section>
	</div>
	
	<div id="myIframe" style="position: fixed;top: 0;bottom: 0;left:0;right:0;background-color: #fff;z-index: 99;display: none;">
		<header class="module-topbar">
	        <a class="fl" id="myClose"><i class="iconfont"><</i></a>
	        <span><spring:message code="attention"/></span>
	    </header>
	</div>
	
	<div class="share-title" style="margin-bottom: 50px;display: none;">
		<p style="float: right;margin: 0;">
			<select id="langType">
				<option value="zh"><spring:message code="chinese"/></option>
				<option value="en"><spring:message code="english"/></option>
			</select>
		</p>
	</div>
	
	<script type="text/javascript" src="${basePath}/resource/js/common/messages_${sessionScope.lang}.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/bootstrap.min.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/bootstrap.autocomplete.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/bootstrap-typeahead-new.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/bootstrap-modalmanager.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/bootstrap-modal.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/modal.manager.plugin1.0.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/jshow.utils.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/sco.modal.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/vendor/sco.confirm.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/common/city.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/common/gps.js"></script>
	<script type="text/javascript" src="${basePath}/resource/js/sentiment.js"></script>
	<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=E4805d16520de693a3fe707cdc962045&s=1"></script>
	<script type="text/javascript" src="${basePath}/resource/js/weathers.js?v=20160125"></script>
	<script type="text/javascript" src="${basePath}/resource/js/common/AlertMessage-1.3.js"></script>
	
</body>
<script type="text/javascript">
$(function() {
	vrv.sentiment.setUp.init();
});
</script>

<script type="text/javascript">

function showIframe(url){
	if ($('.deleteTag').css('visibility') == 'visible'){
		return;
	}
	
	$('#myIframe').css('display','block');
	//添加iframe
	var myHtml = $("<iframe width='98%' scrolling='yes' height='98%' class='YuFrame1' id='YuFrame1' name='YuFrame1' style='padding-top:44px;position:absolute;z-index:4;'? frameborder='no' marginheight='0' marginwidth='0' allowTransparency='true'></iframe>");
	$('#myIframe').append(myHtml);
	$("#YuFrame1").attr("src", url);
}

function shareMessageTip() {
	var lang = localStorage.getItem("lang");
	var userToken = localStorage.getItem("userTonken");
	var data = {
		userId : userToken,
		lang : lang,
		userToken : userToken
	};
   	var _action = userToken+"/message/count.do";
	base.AJAX_POST(_action, data, "json", function(o){
		if (o.data > 0) {
        	$('.module-message-tip').html(o.data + " " +messages.news).show();
        	$('.body').attr('style','padding-top: 38px');
    	}else{
    		$('.module-message-tip').hide();
    		$('.body').removeAttr('style');
    	}
	});
  
}

//一分钟： 60000  十分钟： 600000
//setInterval(shareMessageTip, 600000);

function toMessages() {
    //messageCount = 0;
    var userToken = localStorage.getItem("userTonken");
	var lang = localStorage.getItem("lang");
    $('.module-message-tip').hide();
    $('.body').removeAttr('style');
    var action = '/message.do?userToken='+userToken+'&lang='+lang;
	base.getAction(action);
}
 
$('#langType').change(function(){
	console.log(1);
	var lang = $('#langType').val();
   	var _asction = "attention/index.do?lang="+lang;
	base.getAction(_asction)
});
 
$(function() {

	var userToken = $('#userTonken').val();
	var lang = $('#lang').val();
	// 默认选中语言
	$("#langType").find("option[value='"+lang+"']").attr("selected",true);
	
	localStorage.setItem("userTonken", userToken);
	localStorage.setItem("lang", lang);
	var browser = {
	        versions : function() {
	            var u = navigator.userAgent, app = navigator.appVersion;
	            return {//移动终端浏览器版本信息
	                trident : u.indexOf('Trident') > -1, //IE内核
	                presto : u.indexOf('Presto') > -1, //opera内核
	                webKit : u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
	                gecko : u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
	                mobile : !!u.match(/AppleWebKit.*Mobile.*/)
	                || !!u.match(/AppleWebKit/), //是否为移动终端
	                ios : !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
	                android : u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
	                iPhone : u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
	                iPad : u.indexOf('iPad') > -1, //是否iPad
	                webApp : u.indexOf('Safari') == -1
	                //是否web应该程序，没有头部与底部
	            };
	        }(),
	        language : (navigator.browserLanguage || navigator.language).toLowerCase()
	    }
	
	if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
		function connectWebViewJavascriptBridge(callback) {
	        if (window.WebViewJavascriptBridge) {
	            callback(WebViewJavascriptBridge);
	        } else {
	            document.addEventListener(
	                'WebViewJavascriptBridgeReady'
	                , function() {
	                    callback(WebViewJavascriptBridge);
	                },
	                false
	            );
	        }
	    }
		
		connectWebViewJavascriptBridge(function(bridge) {
	        bridge.init(function(message, responseCallback) {
	            var data = {
	                'Javascript Responds': 'Wee!'
	            };
	            responseCallback(data);
	        });
	        bridge.callHandler('getLocation', {}, function(response) {
	        	if(response.length > 0){
					var mapStrJson = $.parseJSON(response);
                	vrv.weather.view.setWeatherData(mapStrJson.city);
            	}else{
            		vrv.weather.view.setWeatherData("北京市");
            	}
	        });
	    })
	        
    }else if (browser.versions.android) {
    	var mapStr = native.getmap();
		if(mapStr.length > 0){
			var mapStrJson = $.parseJSON(mapStr);
			vrv.weather.view.setWeatherData(mapStrJson.city);
		}else{
			vrv.weather.view.setWeatherData("北京市");
		}
    }
	vrv.weather.view.init();
	
	$('#myClose').click(function(){
		$('#myIframe').css('display','none');
		$('.YuFrame1').remove();
	});
	vrv.sentiment.index.init();
	// 获取消息个数
	shareMessageTip();
	
	function stop(){ 
		return false; 
	} 
	document.oncontextmenu=stop; 

});





</script>
</html>